import {Component, OnInit} from '@angular/core';
import {Router} from "@angular/router";

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {

  constructor(private router: Router) {
  }

  ngOnInit(): void {
  }

  gotoIndex(message: any): void {
    // this.router.navigate(['index'], {queryParams: {msg:message}})
    this.router.navigate(['index'])
      .then(r => console.log('跳转到监控页面'))
  }

  gotoLog(message: any): void {
    // this.router.navigate(['log'], {queryParams: {msg:message}})
    this.router.navigate(['log'])
      .then(r => console.log('跳转到日志页面'))
  }

  gotoRegister(message: any): void {
    // this.router.navigate(['register'], {queryParams: {msg:message}})
    this.router.navigate(['register'])
      .then(r => console.log('跳转到注册页面'))
  }
}
